package command;

public class CommandResolver {
   
	 public static  Command resoleCommand(String commandStr){
		 Command com = new Command();
		 
		 String[] strs = commandStr.split(" ");
		 if(strs.length==2||strs.length==3){
		 if(strs[0].equals("L")||strs[0].equals("C")){
			 com = new Command();
			 com.setKey(strs[0]);
			 if(strs.length==2){
				 com.setOperationType(strs[0]+strs[1]);
				 com.setValues(new String[]{strs[1]});
				 
			 }else{
				 com.setOperationType(strs[0]+strs[1]+strs[2]);
				 com.setValues(new String[]{strs[1],strs[2]});
			 }
			 
		 }
		 }
		 return com;
		 
	 }
	
}
